import React from 'react'
import {Redirect, Route} from 'react-router-dom'
import RouterUtil from './RouterUtil';
import Device from "../device/Device";
import Dish from "../dish/Dish";
import DishInterval from "../dishTypeInterval/DishInterval";
import DishSpec from "../dishSpec/DishSpec";
import DishProcess from "../dishProcess/DishProcess";
import DishTypeSeq from "../dishTypeSeq/DishTypeSeq";
import Priority from "../priority/Priority";


class IndexRouter extends React.Component {

    render() {
        const {device, dish, dishType, dishSpec, dishProcess, dishSeq, priority} = RouterUtil.config;
        return (
            <div>
                <Route exact path="/" render={() => <Redirect to={device}/>}/>
                <Route path={device} component={Device}/>
                <Route path={dish} component={Dish}/>
                <Route path={dishType} component={DishInterval}/>
                <Route path={dishSpec} component={DishSpec}/>
                <Route path={dishProcess} component={DishProcess}/>
                <Route path={dishSeq} component={DishTypeSeq}/>
                <Route path={priority} component={Priority}/>
            </div>
        )
    }
}

export default IndexRouter;